<template>
  <div class="box">
    <div
      class="item"
      @click="getTo(0, '/highshop')"
      :class="activeIndex == 0 ? 'activeItem' : ''"
    >
      店铺首页
    </div>

    <div
      class="item"
      @click="getTo(1, '/highshop')"
      :class="activeIndex == 1 ? 'activeItem' : ''"
    >
      所有商品
    </div>

    <div
      class="item"
      @click="getTo(2, '/highshop')"
      :class="activeIndex == 2 ? 'activeItem' : ''"
    >
      当季新款
    </div>
  </div>
</template>

<script>
export default {
  components: {},

  data() {
    return {
      activeIndex: null,
    };
  },
  created() {},
  methods: {
    getTo(index, url) {
      this.activeIndex = index;
      this.$router.push({
        path: url,
        query: {
          id: this.$parent.storeData.id,
          index:index
        },
      });
    },
  },
};
</script>

<style scoped lang="scss">
.box {
  margin: 0 auto;
  width: 12rem;
  height: 100%;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  .item:first-child {
    margin-left: 0;
  }
  .item {
    cursor: pointer;
    margin-left: 0.2rem;
    width: 0.9rem;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.16rem;
    color: #ffffff;
  }
  .activeItem {
    width: 0.9rem;
    height: 0.24rem;
    line-height: 0.24rem;
    border-radius: 0.1rem;
    background: #d95e0b;
  }
}
</style>
